package main;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import userinterface.TrayWindow;

public class Main {
	/**
	 * @param args
	 */
	public static void main(final String[] args) {
		/* Use an appropriate Look and Feel */
		try {
//			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
			 UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
		} catch (UnsupportedLookAndFeelException ex) {
			ex.printStackTrace();
		} catch (IllegalAccessException ex) {
			ex.printStackTrace();
		} catch (InstantiationException ex) {
			ex.printStackTrace();
		} catch (ClassNotFoundException ex) {
			ex.printStackTrace();
		}
		/* Turn off metal's use of bold fonts */
		UIManager.put("swing.boldMetal", Boolean.FALSE);
		// Schedule a job for the event-dispatching thread: adding TrayIcon.
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				TrayWindow trayWindow = TrayWindow.getInstance();
				if (args != null && args.length > 0) {
					trayWindow.createAndShowGUI(args[0]);
				}
				else {
					trayWindow.createAndShowGUI();
				}
			}
		});
	}
}
